@extends('layout/layout')

@section('content')

	<div class="text-right">
		<form method="post" role="form" action="{{ action('TravelersController@search') }}">
			<div class="form-inline">            
				<input type="text" class="form-control" name="search" placeholder="Search" />
				<button class="btn btn-primary"><span class="glyphicon glyphicon-search"></span></button>
			</div>         
		</form>
	</div>
	
	<hr />
    
	<table class="table table-hover">
		
		<thead>
			<tr>
				<th>Status</th>
				<th>Type</th>
				<th>Nome</th>
				<th>Email</th>
				<th>Telefone</th>
				<th>Celular</th>
				<th></th>
			</tr>
		</thead>
		
		<tbody>
		
			@foreach($travelers as $traveler)
				<tr>
					<td>{{ $traveler->type }}</td>
					<td><b>{{ $traveler->status ? 'PN' : 'OK'  }}</b></td>
					<td>{{ $traveler->name }}</td>
					<td>{{ $traveler->email }}</td>
					<td>{{ $traveler->phone }}</td>
					<td>{{ $traveler->mobilePhone }}</td>
					<td>
						<a href="{{ action('TravelersController@info', $traveler->id) }}"><span class="glyphicon glyphicon-info-sign"></span></a>
						@if ($traveler->status == 0)
							<a href="{{ action('TravelersController@info', $traveler->id) }}"><span class="glyphicon glyphicon-ok"></span></a>
						@else
							<a href="{{ action('TravelersController@status', $traveler->id) }}"><span class="glyphicon glyphicon-remove"></span></a>
						@endif	
					</td>
				</tr>
			@endforeach	
					
		</tbody>
		
	</table>
	
	{{ $travelers->links(); }}
	
@stop